#!/usr/bin/env bash

set -euo pipefail

export BASEROW_AMOUNT_OF_WORKERS=${BASEROW_AMOUNT_OF_WORKERS:-1}
export BASEROW_AMOUNT_OF_GUNICORN_WORKERS=${BASEROW_AMOUNT_OF_GUNICORN_WORKERS:-3}

export DATABASE_PASSWORD=$CLOUDRON_POSTGRESQL_PASSWORD
export DATABASE_NAME=$CLOUDRON_POSTGRESQL_DATABASE
export DATABASE_HOST=$CLOUDRON_POSTGRESQL_HOST
export DATABASE_USER=$CLOUDRON_POSTGRESQL_USERNAME
export DATABASE_PORT=$CLOUDRON_POSTGRESQL_PORT
export BASEROW_PUBLIC_URL=${BASEROW_PUBLIC_URL:-https://$CLOUDRON_APP_DOMAIN}
export BASEROW_CADDY_ADDRESSES=${BASEROW_CADDY_ADDRESSES:-:80}

export DJANGO_SETTINGS_MODULE='baserow.config.settings.base'
export DATA_DIR=/app/data
export DISABLE_EMBEDDED_PSQL=yes

export EMAIL_SMTP="true"
export EMAIL_SMTP_USE_TLS=""
export FROM_EMAIL=$CLOUDRON_MAIL_FROM
export EMAIL_SMTP_HOST=$CLOUDRON_MAIL_SMTP_SERVER
export EMAIL_SMTP_PORT=$CLOUDRON_MAIL_SMTP_PORT
export EMAIL_SMTP_USER=$CLOUDRON_MAIL_SMTP_USERNAME
export EMAIL_SMTP_PASSWORD=$CLOUDRON_MAIL_SMTP_PASSWORD
